﻿using ProjBackEnd.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ProjBackEnd.Areas.Crm.Models
{
    /// <summary>
    /// 客户详情操作请求
    /// </summary>
    public class ReqCusDetail : BaseUserRequest
    {
        /// <summary>
        /// 客户详情
        /// </summary>
        public CusDetailInfo cusdetail { get; set; }
    }

    /// <summary>
    /// 客户核心信息结果集
    /// </summary>
    public class ResultCusName : BaseResultInfoPaging
    {
        /// <summary>
        /// 客户核心信息列表
        /// </summary>
        public List<CusCore> cuscorelist { get; set; } = new List<CusCore>();
    }

    /// <summary>
    /// 未结算客户结果集
    /// </summary>
    public class ResultCusUnSettled : BaseResultInfo
    {
        /// <summary>
        /// 未结算客户列表
        /// </summary>
        public List<CusCore> cuscorelist { get; set; }
    }

    /// <summary>
    /// 客户基本信息结果集
    /// </summary>
    public class ResultCusBaseInfo : BaseResultInfoPaging
    {
        /// <summary>
        /// 客户基本信息列表
        /// </summary>
        public List<CusBaseInfo> cusbaselist { get; set; } = new List<CusBaseInfo>();
    }

    /// <summary>
    /// 客户详细信息结果集
    /// </summary>
    public class ResultCusDetailInfo : BaseResultInfo
    {
        /// <summary>
        /// 客户详情
        /// </summary>
        public CusDetailInfo cusdetail { get; set; }
    }

    /// <summary>
    /// i 客户核心信息
    /// </summary>
    public class CusCore : BaseOperableEntity
    {
        /// <summary>
        /// 客户流水号
        /// </summary>
        [RequiredConditional("optlb", "UD", ErrorMessage = "客户流水号是必需的")]
        public int cusid { get; set; }

        /// <summary>
        /// 客户助记码
        /// </summary>
        [StringLength(20, MinimumLength = 4, ErrorMessage = "助记码长度必需是4~20位")]
        public string cuscd { get; set; }

        /// <summary>
        /// 客户全称
        /// </summary>
        [RequiredConditional("optlb", "U", ErrorMessage = "客户全称是必需的")]
        public string cusnm { get; set; }

        /// <summary>
        /// 客户简称
        /// </summary>
        public string cusnm_sht { get; set; }
    }

    /// <summary>
    /// ii 客户基本信息
    /// </summary>
    public class CusBaseInfo : CusCore
    {
        /// <summary>
        /// 分公司客户流水号
        /// </summary>
        public string cuscomref { get; set; }

        /// <summary>
        /// 客户别名
        /// </summary>
        public string cusnm_alias { get; set; }

        /// <summary>
        /// 法人代表
        /// </summary>
        public string corp { get; set; }

        /// <summary>
        /// 注册地址
        /// </summary>
        public string regaddchn { get; set; }

        /// <summary>
        /// 社会统一信用代码
        /// </summary>
        public string usccode { get; set; }

        /// <summary>
        /// 纳税人识别号
        /// </summary>
        public string taxno { get; set; }

        /// <summary>
        /// 联系地址
        /// </summary>
        public string addrchn { get; set; }

        /// <summary>
        /// 联系人
        /// </summary>
        public string contact { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        public string tel { get; set; }

        /// <summary>
        /// 人民币开户行名称
        /// </summary>
        public string cnybanknm_chn { get; set; }

        /// <summary>
        /// 人民币银行账号
        /// </summary>
        public string cnybankno { get; set; }

        /// <summary>
        /// 美金开户行名称
        /// </summary>
        public string usdbanknm_chn { get; set; }

        /// <summary>
        /// 美金银行账号
        /// </summary>
        public string usdbankno { get; set; }

        /// <summary>
        /// 纳税人类别
        /// 0-一般纳税人；1-小规模纳税人；2-非增值税纳税人
        /// </summary>
        public string taxpayertp { get; set; }

        /// <summary>
        /// 客户所属的我方公司
        /// </summary>
        public string comcd { get; set; }

        /// <summary>
        /// 包含合同数
        /// </summary>
        public int ctcount { get; set; }

        /// <summary>
        /// 默认税率
        /// </summary>
        public decimal deftaxrate { get; set; }

        /// <summary>
        /// 账期
        /// </summary>
        public int period { get; set; }
    }

    /// <summary>
    /// iii 客户详细信息
    /// </summary>
    public class CusDetailInfo : CusBaseInfo
    {
        /// <summary>
        /// 联系地址（英文）
        /// </summary>
        public string addreng { get; set; }

        /// <summary>
        /// 注册地址（英文）
        /// </summary>
        public string regaddreng { get; set; }

        /// <summary>
        /// 传真号码
        /// </summary>
        public string fax { get; set; }

        /// <summary>
        /// 电邮地址
        /// </summary>
        public string email { get; set; }

        /// <summary>
        /// 人民币开户行名称（英文）
        /// </summary>
        public string cnybanknm_eng { get; set; }

        /// <summary>
        /// 人民币开户行地址（中文）
        /// </summary>
        public string cnybankaddr_chn { get; set; }

        /// <summary>
        /// 人民币开户行地址（英文）
        /// </summary>
        public string cnybankaddr_eng { get; set; }

        /// <summary>
        /// 人民币开户行代码
        /// </summary>
        public string cnycode { get; set; } //

        /// <summary>
        /// 美金开户行名称（英文）
        /// </summary>
        public string usdbanknm_eng { get; set; }

        /// <summary>
        /// 美金开户行地址（中文）
        /// </summary>
        public string usdbankaddr_chn { get; set; }

        /// <summary>
        /// 美金开户行地址（英文）
        /// </summary>
        public string usdbankaddr_eng { get; set; }

        /// <summary>
        /// 美金开户行代码
        /// </summary>
        public string usdcode { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        public string modid { get; set; }

        /// <summary>
        /// 最近一次修改日期
        /// </summary>
        public string moddt { get; set; }

        /// <summary>
        /// 冻结标志：
        /// Y-已冻结；N-未冻结
        /// </summary>
        public string freezelb { get; set; }

        /// <summary>
        /// 是否上传了营业执照：
        /// Y-已上传；N-未上传
        /// </summary>
        public string mblsfile { get; set; }

        /// <summary>
        /// 是否上传了税务登记证：
        /// Y-已上传；N-未上传
        /// </summary>
        public string txfile { get; set; }

        /// <summary>
        /// 客户财务编码（关联浪潮、金蝶等财务系统）
        /// </summary>
        public string cusref_inner { get; set; }
    }


}